package cn.sunshine.ymcc.fegin;

import cn.sunshine.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class FallbackFactoryMediaFeign implements FallbackFactory<MediaFeign> {

    @Override
    public MediaFeign create(Throwable throwable) {

        return new MediaFeign() {
            @Override
            public JSONResult getCourseVideo(Long courseId) {
                throwable.printStackTrace();
                return JSONResult.error("服务调不通，请仔细检查");
            }
        };
    }
}
